//
//  FeedbackController.m
//  i5db
//
//  Created by iMuse on 15-5-19.
//  Copyright (c) 2015年 mySelf. All rights reserved.
//

#import "FeedbackController.h"
#import "AppCenter.h"
@interface FeedbackController ()
{
    UITextView * textView;
}

@end

@implementation FeedbackController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = @"反馈";
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self initNavigationBar];
    [self initView];
   
}
-(void)initNavigationBar
{
    [super initNavigationBar];
    UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(0, 0, 44, 44);
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [button setTitle:@"发送" forState:UIControlStateNormal];
    
    /* [button setImage:[UIImage imageNamed:@"edit.png"] forState:UIControlStateNormal];
     [button setImage:[UIImage imageNamed:@"edit.png"] forState:UIControlStateSelected];
     */
    
    [button addTarget:self action:@selector(sendMessage:) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *temporaryBarButtonItem2 = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    temporaryBarButtonItem2.style = UIBarButtonItemStylePlain;
    
    self.navigationItem.rightBarButtonItem = temporaryBarButtonItem2;
}

-(void)sendMessage:(UIButton*)button
{
    
}

-(void)initView
{
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    textView = [UITextView newAutoLayoutView];
    textView.textAlignment = NSTextAlignmentNatural;
    
    textView.layer.cornerRadius = 6;
    textView.layer.borderWidth = 0.5;
    textView.layer.borderColor = [AppCenter color:@"188,188,188,1"].CGColor;
    [self.view addSubview:textView];
    
    [textView autoPinToTopLayoutGuideOfViewController:self withInset:10];
    [textView autoPinEdgeToSuperviewEdge:ALEdgeLeft withInset:10];
    [textView autoPinEdgeToSuperviewEdge:ALEdgeRight withInset:10];
    [textView autoSetDimension:ALDimensionHeight toSize:200];
}

- (void)viewWillAppear:(BOOL)animated {
    
    
    [[self rdv_tabBarController] setTabBarHidden:YES animated:NO];
    [super viewWillAppear:animated];
    
    
}


- (void)viewWillDisappear:(BOOL)animated {
    
    [[self rdv_tabBarController] setTabBarHidden:NO animated:NO];
    
    [super viewWillDisappear:animated];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
